package com.qfedu.controller;

import com.qfedu.entity.User;
import com.qfedu.service.intf.UserService;
import com.qfedu.vo.PageVo;
import com.qfedu.vo.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/api/user/")
public class UserController {
    @Resource
    private UserService service;

    @ResponseBody
    @RequestMapping("add.do")
    public R add(User user){
        return service.add(user);
    }

    @ResponseBody
    @RequestMapping("page.do")
    public PageVo page(int page, int limit){
        System.out.println(page);
        return service.queryPage(page,limit);
    }

}
